from vec3 import Vec3

class PointMass:
    def __init__(self, pos = Vec3(), mass = 1):
        self.lastPos = self.pos = pos
        self.vel = Vec3()
        self.force = Vec3()
        self.mass = mass

    def applyForce(self, f):
        self.force += f

    def tick(self, dt):
        acc = self.force / self.mass - self.vel
        self.vel += acc * dt
        self.lastPos = self.pos
        self.pos += self.vel * dt
        self.force = Vec3()
